refactor(key-wallet): drop unused is_watch_only from ManagedCoreAccount#718
refactor(key-wallet): drop unused is_watch_only from ManagedCoreAccount#718QuantumExplorer merged 2 commits intov0.42-devfrom
is_watch_only from ManagedCoreAccount#718Conversation
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR removes the ChangesManaged Account Watch-Only Flag Removal
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v0.42-dev #718 +/- ##
=============================================
- Coverage 71.17% 71.16% -0.02%
=============================================
Files 320 320
Lines 68610 68577 -33
=============================================
- Hits 48836 48802 -34
- Misses 19774 19775 +1
|
|
This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them. |
…ccounts
The `is_watch_only` field on `ManagedCoreKeysAccount` (and its mirror through
`ManagedCoreFundsAccount`) is just propagated from the immutable parent
`Account`. Nothing in the workspace reads it for any decision — every
`if watch-only { deny }` check (`key-wallet-ffi/src/keys.rs:85`,
`key-wallet-ffi/src/account_derivation.rs:41,231,262`) reads
`FFIAccount.inner().is_watch_only`, i.e. the immutable `Account`, not the
managed copy. The denormalized field exists only as test assertions and an
`#[no_mangle]` getter (`managed_core_account_get_is_watch_only`) that nothing
in this repo invokes.
This drops:
- The `is_watch_only` field on `ManagedCoreKeysAccount`
- The `is_watch_only` parameter on `ManagedCoreKeysAccount::new`,
`ManagedCoreFundsAccount::new`, and the
`create_managed_account_from_*` helpers
- `ManagedAccountTrait::is_watch_only`
- The `managed_core_account_get_is_watch_only` FFI export
`ManagedPlatformAccount.is_watch_only` and
`managed_platform_account_get_is_watch_only` are unchanged.
Breaking change: any out-of-tree C/Swift consumer of
`managed_core_account_get_is_watch_only` should switch to
`account_get_is_watch_only` on the parent `FFIAccount`, or
`wallet_is_watch_only` for the wallet-level status.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4173c4f to
ca8c528
Compare
The verify-ffi pre-commit hook flagged that key-wallet-ffi/FFI_API.md still listed `managed_core_account_get_is_watch_only`, which this PR removes. Regenerated to drop the entry.
Summary
The mutable
ManagedCoreAccountcarries anis_watch_only: boolthat's just propagated from the immutable parentAccount. Nothing in the workspace reads it for any decision — everyif watch-only { deny }check (key-wallet-ffi/src/keys.rs:85,key-wallet-ffi/src/account_derivation.rs:41,231,262) readsFFIAccount.inner().is_watch_only, i.e. the immutableAccount, not the managed copy. The denormalized field exists only as test assertions and an#[no_mangle]getter (managed_core_account_get_is_watch_only) that nothing in this repo invokes.This drops:
is_watch_onlyfield onManagedCoreAccountis_watch_onlyparameter onManagedCoreAccount::newand thecreate_managed_account_from_*helpersManagedAccountTrait::is_watch_onlymanaged_core_account_get_is_watch_onlyFFI exportManagedPlatformAccount.is_watch_onlyandmanaged_platform_account_get_is_watch_onlyare unchanged.Breaking change
Any out-of-tree C/Swift consumer of
managed_core_account_get_is_watch_onlywill need to switch to either:account_get_is_watch_onlyon the parentFFIAccount, orwallet_is_watch_onlyfor the wallet-level status.Test plan
cargo check --all— cleancargo test -p key-wallet --lib— 461 passedcargo test -p key-wallet-ffi --lib— 217 passedcargo test -p key-wallet-manager --lib— 31 passedcargo clippy --all-features --all-targets— cleancargo fmt🤖 Generated with Claude Code
Summary by CodeRabbit